<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			function Student(name, age) {
				this.name = name;
				this.age = age;
				this.study = function() {
					console.log("先好好学习");
				}
			}

			Student.score = 90; //静态属性

			// let stu = new Student("张三", 20);
			// console.log(stu.name);
			// console.log(stu.score);
			// console.log(Student.score);

			class Student2 {
				static score = 100; //静态属性
				constructor(name, age) {
					this.name = name;
					this.age = age;
				}

				study() {
					console.log("先好好学习");
				}
			}
			
			let stu = new Student2("张三", 20);
			console.log(stu.name);
			console.log(stu.score);
			console.log(Student2.score);
		</script>
	</body>
</html>
